// 媒体配置通用接口
export interface MediaConfig {
    id: string;
    type: 'video' | 'audio' | 'text';
}

// 视频配置接口
export interface VideoConfig extends MediaConfig {
    src: string;
    config: {
        target_timerange: [number, number];
        source_timerange: [number, number];
        speed: number;
        volume: number;
        clip_settings: {
            alpha: number;
            flip_horizontal: boolean;
            flip_vertical: boolean;
            rotation: number;
            scale_x: number;
            scale_y: number;
            transform_x: number;
            transform_y: number;
        };
    };
    animation: {
        animation_type: string;
        params: string | Record<string, any>;
        duration: string;
    };
    effect: {
        effect_type: string;
        params: string | Record<string, any>;
    };
    filter: {
        filter_type: string;
        intensity: number;
    };
    mask: {
        mask_type: string;
        center_x: number;
        center_y: number;
        size: number;
        rotation: number;
        feather: number;
        invert: boolean;
        rect_width: number | null;
        round_corner: number | null;
    };
    transition: {
        transition_type: string;
        duration: string;
    };
}

// 音频配置接口
export interface AudioConfig extends MediaConfig {
    src: string;
    config: {
        target_timerange: [number, number];
        source_timerange: [number, number];
        speed: number;
        volume: number;
    };
    affect: {
        effect_type: string;
        params: string | Record<string, any>;
    };
    fade: {
        in_duration: string;
        out_duration: string;
    };
}

// 文本配置接口
export interface TextConfig extends MediaConfig {
    content: string;
    timerange: [number, number];
    font: string;
    style: {
        size: number;
        bold: boolean;
        italic: boolean;
        underline: boolean;
        color: [number, number, number];
        alpha: number;
        align: number;
        vertical: boolean;
        letter_spacing: number;
        line_spacing: number;
    };
    clip_settings: {
        alpha: number;
        flip_horizontal: boolean;
        flip_vertical: boolean;
        rotation: number;
        scale_x: number;
        scale_y: number;
        transform_x: number;
        transform_y: number;
    };
    border: {
        alpha: number;
        color: [number, number, number];
        width: number;
    };
    background: {
        color: [number, number, number];
        style: number;
        alpha: number;
        round_radius: number;
        height: number;
        width: number;
        horizontal_offset: number;
        vertical_offset: number;
    };
    bubble?: {
        effect_id: string;
        resource_id: string;
    };
    effect?: {
        effect_id: string;
    };
    animation: {
        animation_type: string;
        params: string | Record<string, any>;
        duration: string;
    };
}

// 拖拽元素配置接口
export interface DragElementConfig {
    type: string;
    zIndex: number;
    config: any;
}

// VideoEditor组件属性接口
export interface VideoEditorProps {
    videos: VideoConfig[];
    audios?: AudioConfig[];
    texts?: TextConfig[];
    onConfigChange?: (config: { videos: VideoConfig[]; audios: AudioConfig[]; texts: TextConfig[] }) => void;
}
